//var plugin = requirePlugin("myPlugin")
Page({
  data: {
    startTime: '00:00',
    endTime: '00:00',
    unit: 60*24,
    reserveUnit: 60,
    activedConst: 101,
    disabledConst: 102,
    unreserveTime: [],
  },
  onLoad() {
    // 动态设置非服务事件
    setTimeout(() => {
      this.setData({
        unreserveTime: [
          {
            startTime: '2019-10-17 11:00:00',
            endTime: '2019-10-17 12:00:00',
            status: 102,    // 不能选中
          },
          {
            startTime: '2019-10-17 16:00:00',
            endTime: '2019-10-17 16:00:00',
            status: 102,    // 不能选中
          },
          {
            startTime: '2019-10-18 16:00:00',
            endTime: '2019-10-18 16:00:00',
            status: 102,    // 不能选中
          },
        ]
      });
    }, 2000)
  },
  onSelectTime(e) {
    const { startTimeText, endTimeText } = e.detail;
    console.log('startTimeText ', startTimeText)
    console.log('endTimeText ', endTimeText)
    this.setData({
      startTimeText,
      endTimeText,
      showModalStatus: false,
    })
  },
  showModal: function () {
    // 显示遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "ease-in-out",
      delay: 0
    })
    this.animation = animation
    animation.translateY(500).step()
    this.setData({
      animationData: animation.export(),
      showModalStatus: true
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export()
      })
    }.bind(this), 200)
  },
  hideModal: function () {
    this.setData({
      showModalStatus: false,
    })

  },
})